<? 
		
	require("required/dbconnect.php"); 
	require_once("required/function.php");
	require("required/header.php");
	checkAccess("allow_content_management",1);
	
	$id=$_GET['id'];
	$get_id=mysql_query("select * from os_announcement where id=$id");

	$a=mysql_fetch_array($get_id,MYSQL_ASSOC);
	
?>
			<script language="JavaScript" src="required/js/calendarDateInput.js"></script>
            <script language="javascript">
				
					
					function validatefrm(frm1)
					{
						if(document.frm1.title.value=="")
						{
							alert("Please enter title");
							document.frm1.title.focus();
							return false;
						}
						
						return true;
					
					}
				</script>
				<table width="100%"  cellpadding="5" cellspacing="0" height="300">
				
			
					<td width="100%" align="left" valign="top">
						<form action="announcement_edit2.php" name="frm1" method="post" onSubmit="return validatefrm(this)" >
						<table width="100%">
								<td class="title" colspan="3"><strong>Edit Announcement</strong></td>
						 	<tr valign="top">
                                <td width="100">Title</td><td width="20">:</td>
                                <td>
                                   <input type="text" name="title" size="50" maxlength="200"  value="<?= $a['title'] ?>"/>    
                                </td>
                            </tr>
                            <tr>
								<td>Type</td><td>:</td>
                                <td>
									<select name="content_type">
                                    	<option value="<?= $a['content_type'] ?>"><?= $a['content_type'] ?></option>
                                    	<option value="News">News</option>
                                        <option value="Promotions">Promotion</option>
                                        <option value="Events">Events</option>
                                    </select>
                                </td>
                            </tr>
                            <tr valign="top">
                                <td>Brief Description</td><td>:</td>
                                <td>
                                     <textarea cols="30" rows="5" name="brief_description" class="text"><?= $a['brief_description'] ?></textarea>    
                                </td>
                            </tr>    
                            <tr>
								<td>Date</td><td>:</td><td>
                                <script>
									var create_date='<?= $a['create_date'] ?>';
								</script>
								<script>DateInput('create_date', true, 'YYYY-MM-DD',create_date)</script>
								</td>
                            </tr>
                            <tr>
                                <td>Show</td><td>:</td><td>
								<?
									if($a['status']==0)
									{
										$slt0="selected";
										$slt1="";
										
									}
									else
									{
										$slt0="";
										$slt1="selected";
									}
								?>
								<select name="status" class="text">
									<option value="0" <?= $slt0 ?>>No</option>
									<option value="1" <?= $slt1 ?>>Yes</option>
								</select>	
                                </td>
                            </tr>
						 	
                       
                            <tr valign="top">
                                <td>Content</td><Td>:</Td>
                            </tr>
                            <tr>    
                                <td valign="top" colspan="3">
                                   <? include_once("fckeditor/fckeditor.php") ?>
                                    <?php
                                        $oFCKeditor = new FCKeditor('content_eng') ;
                                        $oFCKeditor->ToolbarSet = 'DeswinBasic';
                                        $oFCKeditor->BasePath = './fckeditor/' ;
                                        $oFCKeditor->Value = $a['content_eng'] ;
                                        $oFCKeditor->Create() ;
                                    ?>
                                  
                                    
                                </td>
                            </tr>
                            <tr valign="top">
                                <td><br>
                                </td>
                            </tr>
                            
                            <tr>
                                <td colspan="2">
                                
                         
                                
                                <input type="hidden" value="<?= $id ?>" name="hidid" />
                                <input type="submit" value="Update" name="btnsubmit" >
                                 <input type="button" value="Back" name="btnsubmit" onclick="window.open('announcement_viewfull.php?id=<?= $id ?>','_self')">
                                
                                </td>
                            </tr>
						</table>
						</form>
					</td>
				 
				</table>
<? require("required/footer.php"); ?>